$(function () {
	//获取焦点
	$("#reg-form").on("focus", "input", function () {
		$(this).closest('.inputstyle').addClass('focus');
	}).on("blur", "input", function () {
		$(this).closest('.inputstyle').removeClass('focus');
	});

	$("#reg-form").on("focus", "input", function () {
		$(this).closest('.yz_input').addClass('focus');
	}).on("blur", "input", function () {
		$(this).closest('.yz_input').removeClass('focus');
	});

	//再次发送
	$("#retform").click(function () {
		$(".regsuccess").hide();
		$(".retform").show();
		$("#formh2").text("再次发送邮件");
	});


	var reg = $("#reg-form").Validform({
		btnSubmit: ".form_btn",
		tiptype: 4,
		showAllError: true,
		ajaxPost: false
	});

	reg.addRule([
		{
			ele: "#mobile",
			ajaxurl: "/user/realtion",
			datatype: "m",
			sucmsg: " ",
			tip: "请输入手机号",
			value: "请输入手机号"
		},
		{
			ele: "#email",
			ajaxurl: "/user/realtion",
			datatype: "e",
			sucmsg: " ",
			tip: "请输入邮箱号",
			value: "请输入邮箱号"
		},
		{
			ele: "#verify",
			ajaxurl: "/user/realtion",
			datatype: "n4-4",
			sucmsg: " ",
			tip: "请输入验证码",
			value: "请输入验证码"
		}
	]);

});
